package com.test.executorPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 *
 *
 * 线程池简单例子
 *
 *
 * @author:wesley
 */
public class ExecutorPoolTest2 {

    public static void main(String[] args) throws InterruptedException {

        ExecutorService executorService = Executors.newCachedThreadPool();

        for (int i = 0; i < 5; i++) {
            executorService.execute(new Runnable() {
                @Override
                public void run() {
                    System.out.println("开始。。");
                }
            });
        }
        Thread.sleep(2000);
        System.exit(0);
    }




}
